package com.zhangjq.simplefactory;

import com.zhangjq.common.AliIPay;
import com.zhangjq.common.CardIPay;
import com.zhangjq.common.IPay;
import com.zhangjq.common.TencentIPay;

/**
 * Created by Administrator on 2019/3/9 0009.
 */
public class PayFactory1 {
    public IPay pay(String payType){
        if ("aliPay".equals(payType)){
            return new AliIPay();
        }else if ("tencentPay".equals(payType)){
            return new TencentIPay();
        }else if ("cardPay".equals(payType)){
            return new CardIPay();
        }else{
            return null;
        }
    }
}
